<?xml version="1.0" encoding="utf-8" ?>
<Feature id="Calendar" name="Calendar">

	<BusinessRules>
		<BusinessRule name="getCalendarEventTypes" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="updateCalendarEventType" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="deleteCalendarEventType" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="getCalendarEventsInRange" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="getDetailedCalendarEventsInRange" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="getCalendarEvents" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="isUserEnrolledInEvent" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="getCalendarEventDetails" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="updateCalendarEvent" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="deleteCalendarEvent" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="getCalendars" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="updateCalendar" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="deleteCalendar" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="getCalendarAppFunctions" security="disabled">
			<Option value="$CalendarRemoteTier$">
				<RemoteRule url="$CalendarRemoteTier$" />
				<LocalClass name="Calendars.CalendarEventBizRules,ScsCore" />
			</Option>
		</BusinessRule>
	</BusinessRules>

	<BusinessObjects>
		<BusinessObject type="Calendar" extends="Article" key="id">
			<Field name="calendarType" type="String" /> <!-- Value needs to match up to an XML file  in the Calendars catalog-->
			<Field name="views" type="List(CalendarView)" /> <!-- Values come from the Calendars catalog entry who's name matches the calendarType -->
		</BusinessObject>

		<BusinessObject type="CalendarView" key="name">
			<Field name="name" type="String" />
			<Field name="readOnlyTemplate" type="String" />
			<Field name="partners" type="List(CalendarPartner)" />
		</BusinessObject>

		<BusinessObject type="CalendarPartner" key="name">
			<Field name="name" type="String" />
			<Field name="isRange" type="Boolean">false</Field>
			<Field name="dateField" type="String" />
			<Field name="endDateField" type="String" />
			<Field name="getBizRule" type="String" />
			<Field name="readOnlyTemplate" type="String" />
			<Field name="widgetClass" type="String" />
		</BusinessObject>

		<BusinessObject type="CalendarEventType" extends="Article" key="id">
			<Field name="allowEnrollment" type="Boolean" />
			<Field name="backColor" type="String">Transparent</Field>
			<Field name="foreColor" type="String" />
			<Field name="useColorForDateArea" type="Boolean" />
			<Field name="mapImageName" type="String" />
			<Field name="cacheName" type="String" />
			<Field name="mapImageUrl" type="String" />
			<Field name="calendarId" type="Guid"><NULL/></Field>
		</BusinessObject>

		<BusinessObject type="CalendarEvent" extends="Article" key="id">
			<Field name="calendarId" type="Guid"><NULL/></Field>
			<Field name="extraContent" type="Article" />
			<Field name="startTime" type="Date" />
			<Field name="endTime" type="Date" />
			<Field name="type" type="CalendarEventType" />
			<Field name="enrollmentType" type="Integer" /> <!-- 0=no-->
			<Field name="maxCapacity" type="Integer" />
			<Field name="currentEnrollment" type="Integer" />
			<Field name="location" type="Address" />
			<Field name="allDayEvent" type="Boolean" />
			<Field name="enrolled" type="List(User)" />

			<Field name="openEnrollment" type="Boolean" />

			<Method name="dateRangeDisplay" language="jscript.NET"><![CDATA[
				return CalendarAssist.calcDisplayName(self.getItem("startTime"), self.getItem("endTime"), self.getItem("allDayEvent"), false);
			]]></Method>
			<Method name="fullDateRangeDisplay" language="jscript.NET"><![CDATA[
				return CalendarAssist.calcDisplayName(self.getItem("startTime"), self.getItem("endTime"), self.getItem("allDayEvent"), true);
			]]></Method>
		</BusinessObject>

		<BusinessObject type="CalendarSearch" key="id">
			<Field name="id" type="Guid" />
			<Field name="startTime" type="Date" />
			<Field name="endTime" type="Date" />
		</BusinessObject>
	</BusinessObjects>

	<ApplicationData>
		<Entry name="Calendars" nodeType="catalog from $CatalogHome$/Calendars">
			Swaf.BizObj.basic.FullBizObj,SwafCore
		</Entry>
	</ApplicationData>

	<ApplicationFunctions id="Calendar" description="Site Calendar functionality">
		<AppFunction id="ManageCalendar" description="Manage Calendar" />
		<DynamicAppFunction id="CalendarAppFunctions" bizrule="getCalendarAppFunctions" bizobjType="ArticleAppFunction" scope="companyId"/>
	</ApplicationFunctions>

	<ClassFactory id="BizProcs">
		<Class type="Calendars.Gui.CalendarViewBizProc,ScsCore" name="CalView"/>
		<Class type="Calendars.Gui.CalendarEventsBizProc,ScsCore" name="CalEvents"/>
		<Class type="Calendars.Gui.CalendarEventTypesBizProc,ScsCore" name="CalEventTypes"/>
		<Class type="Calendars.Gui.CalendarsBizProc,ScsCore" name="Calendars"/>
		<Class type="Calendars.Gui.CalendarEventSearchBizProc,ScsCore" name="CalEventSearch"/>
	</ClassFactory>
</Feature>